home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / AIncludes / MIDI.a < prev    next >
Encoding:
Text File  |  1996-01-24  |  20.1 KB  |  1,004 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        MIDI.a
  3. ;
  4. ;    Contains:    MIDI Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.2 in “MPW” on ETO #20
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__MIDI__') = 'UNDEFINED' THEN
  21. __MIDI__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  25.     include 'Errors.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  30.     include 'Types.a'
  31.     ENDIF
  32.  
  33.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  34.     include 'MixedMode.a'
  35.     ENDIF
  36. ;
  37. ;                        * * *  N O T E  * * * 
  38. ;
  39. ;    This file has been updated to include MIDI 2.0 interfaces.  
  40. ;    
  41. ;    The MIDI 2.0 interfaces were developed for the classic 68K runtime.
  42. ;    Since then, Apple has created the PowerPC and CFM 68K runtimes.
  43. ;    Currently, the extra functions in MIDI 2.0 are not in InterfaceLib
  44. ;    and thus not callable from PowerPC and CFM 68K runtimes (you'll
  45. ;    get a linker error).  
  46. ;
  47.  
  48. midiMaxNameLen                    EQU        31                    ;maximum number of characters in port and client names
  49. ; Time formats 
  50. midiFormatMSec                    EQU        0                    ;milliseconds
  51. midiFormatBeats                    EQU        1                    ;beats
  52. midiFormat24fpsBit                EQU        2                    ;24 frames/sec.
  53. midiFormat25fpsBit                EQU        3                    ;25 frames/sec.
  54. midiFormat30fpsDBit                EQU        4                    ;30 frames/sec. drop-frame
  55. midiFormat30fpsBit                EQU        5                    ;30 frames/sec.
  56. midiFormat24fpsQF                EQU        6                    ;24 frames/sec. longInt format 
  57. midiFormat25fpsQF                EQU        7                    ;25 frames/sec. longInt format 
  58. midiFormat30fpsDQF                EQU        8                    ;30 frames/sec. drop-frame longInt format 
  59. midiFormat30fpsQF                EQU        9                    ;30 frames/sec. longInt format 
  60. midiInternalSync                EQU        0                    ;internal sync
  61. midiExternalSync                EQU        1                    ;external sync
  62. ; Port types
  63. midiPortTypeTime                EQU        0                    ;time port
  64. midiPortTypeInput                EQU        1                    ;input port
  65. midiPortTypeOutput                EQU        2                    ;output port
  66. midiPortTypeTimeInv                EQU        3                    ;invisible time port
  67. midiPortInvisible                EQU        $8000                ;logical OR this to other types to make invisible ports
  68. midiPortTypeMask                EQU        $0007                ;logical AND with this to convert new port types to old,
  69. ;                                      ie. to strip the property bits
  70. ; OffsetTimes  
  71. midiGetEverything                EQU        $7FFFFFFF            ;get all packets, regardless of time stamps
  72. midiGetNothing                    EQU        $80000000            ;get no packets, regardless of time stamps
  73. midiGetCurrent                    EQU        $00000000            ;get current packets only
  74.  
  75. ;    MIDI data and messages are passed in MIDIPacket records (see below).
  76. ;    The first byte of every MIDIPacket contains a set of flags
  77. ;
  78. ;    bits 0-1    00 = new MIDIPacket, not continued
  79. ;                     01 = begining of continued MIDIPacket
  80. ;                     10 = end of continued MIDIPacket
  81. ;                     11 = continuation
  82. ;    bits 2-3     reserved
  83. ;
  84. ;    bits 4-6      000 = packet contains MIDI data
  85. ;
  86. ;                  001 = packet contains MIDI Manager message
  87. ;
  88. ;    bit 7         0 = MIDIPacket has valid stamp
  89. ;                  1 = stamp with current clock
  90. ;
  91. midiContMask                    EQU        $03
  92. midiNoCont                        EQU        $00
  93. midiStartCont                    EQU        $01
  94. midiMidCont                        EQU        $03
  95. midiEndCont                        EQU        $02
  96. midiTypeMask                    EQU        $70
  97. midiMsgType                        EQU        $00
  98. midiMgrType                        EQU        $10
  99. midiTimeStampMask                EQU        $80
  100. midiTimeStampCurrent            EQU        $80
  101. midiTimeStampValid                EQU        $00
  102. ; MIDIPacket command words (the first word in the data field for midiMgrType messages) 
  103. midiOverflowErr                    EQU        $0001
  104. midiSCCErr                        EQU        $0002
  105. midiPacketErr                    EQU        $0003
  106. ;all command words less than this value are error indicators
  107. midiMaxErr                        EQU        $00FF
  108. ; Valid results to be returned by readHooks 
  109. midiKeepPacket                    EQU        0
  110. midiMorePacket                    EQU        1
  111. midiNoMorePacket                EQU        2
  112. midiHoldPacket                    EQU        3
  113. ; Driver calls 
  114. midiOpenDriver                    EQU        1
  115. midiCloseDriver                    EQU        2
  116.  
  117. mdvrAbortNotesOff                EQU        0                    ;abort previous mdvrNotesOff request
  118. mdvrChanNotesOff                EQU        1                    ;generate channel note off messages
  119. mdvrAllNotesOff                    EQU        2                    ;generate all note off messages
  120. mdvrStopOut                        EQU        0                    ;stop calling MDVROut temporarily
  121. mdvrStartOut                    EQU        1                    ;resume calling MDVROut
  122.  
  123. MIDIPacket                 RECORD    0
  124. flags                     ds.b   1        ; offset: $0 (0)
  125. len                         ds.b   1        ; offset: $1 (1)
  126. tStamp                     ds.l   1        ; offset: $2 (2)
  127. data                     ds.b   249        ; offset: $6 (6)
  128.                          ORG 256
  129. sizeof                     EQU *            ; size:   $100 (256)
  130.                         ENDR
  131.  
  132. ; typedef struct MIDIPacket  MIDIPacket
  133. ; typedef MIDIPacket         *MIDIPacketPtr
  134. MIDIClkInfo             RECORD    0
  135. syncType                 ds.w   1        ; offset: $0 (0)        ;synchronization external/internal
  136. curTime                     ds.l   1        ; offset: $2 (2)        ;current value of port's clock
  137. format                     ds.w   1        ; offset: $6 (6)        ;time code format
  138. sizeof                     EQU *            ; size:   $8 (8)
  139.                         ENDR
  140.  
  141. ; typedef struct MIDIClkInfo  MIDIClkInfo
  142. MIDIIDRec                 RECORD    0
  143. clientID                 ds.l   1        ; offset: $0 (0)
  144. portID                     ds.l   1        ; offset: $4 (4)
  145. sizeof                     EQU *            ; size:   $8 (8)
  146.                         ENDR
  147.  
  148. ; typedef struct MIDIIDRec     MIDIIDRec
  149. MIDIPortInfo             RECORD    0
  150. portType                 ds.w   1        ; offset: $0 (0)        ;type of port
  151. timeBase                 ds     MIDIIDRec ; offset: $2 (2)        ;MIDIIDRec for time base
  152. numConnects                 ds.w   1        ; offset: $A (10)        ;number of connections
  153. cList                     ds     MIDIIDRec ; offset: $C (12)        ;ARRAY [1..numConnects] of MIDIIDRec
  154. sizeof                     EQU *            ; size:   $14 (20)
  155.                         ENDR
  156.  
  157. ; typedef struct MIDIPortInfo  MIDIPortInfo
  158. ; typedef MIDIPortInfo         *MIDIPortInfoPtr, **MIDIPortInfoHdl, **MIDIPortInfoHandle
  159. MIDIPortParams             RECORD    0
  160. portID                     ds.l   1        ; offset: $0 (0)        ;ID of port, unique within client
  161. portType                 ds.w   1        ; offset: $4 (4)        ;Type of port - input, output, time, etc.
  162. timeBase                 ds.w   1        ; offset: $6 (6)        ;refnum of time base, 0 if none
  163. offsetTime                 ds.l   1        ; offset: $8 (8)        ;offset for current time stamps
  164. readHook                 ds.l   1        ; offset: $C (12)        ;routine to call when input data is valid
  165. refCon                     ds.l   1        ; offset: $10 (16)        ;refcon for port (for client use)
  166. initClock                 ds     MIDIClkInfo ; offset: $14 (20)    ;initial settings for a time base
  167. name                     ds.l   64        ; offset: $1C (28)        ;name of the port, This is a real live string, not a ptr.
  168. sizeof                     EQU *            ; size:   $11C (284)
  169.                         ENDR
  170.  
  171. ; typedef struct MIDIPortParams  MIDIPortParams
  172. ; typedef MIDIPortParams     *MIDIPortParamsPtr
  173. MIDIIDList                 RECORD    0
  174. numIDs                     ds.w   1        ; offset: $0 (0)
  175. list                     ds.l   1        ; offset: $2 (2)
  176. sizeof                     EQU *            ; size:   $6 (6)
  177.                         ENDR
  178.  
  179. ; typedef struct MIDIIDList  MIDIIDList
  180. ; typedef MIDIIDList         *MIDIIDListPtr, **MIDIIDListHdl, **MIDIIDListHandle
  181. ; MDVR Control structs
  182. MDVRInCtlRec             RECORD    0
  183. timeCodeClock             ds.w   1        ; offset: $0 (0)        ;refnum of time base for time code
  184. timeCodeFormat             ds.w   1        ; offset: $2 (2)        ;format of time code output
  185. readProc                 ds.l   1        ; offset: $4 (4)        ;proc to call with intput characters
  186. commProc                 ds.l   1        ; offset: $8 (8)        ;proc to call for handshaking
  187. refCon                     ds.l   1        ; offset: $C (12)        ;refCon passed to readProc, commProc
  188. sizeof                     EQU *            ; size:   $10 (16)
  189.                         ENDR
  190.  
  191. ; typedef struct MDVRInCtlRec  *MDVRInCtlPtr
  192. MDVROutCtlRec             RECORD    0
  193. timeCodeClock             ds.w   1        ; offset: $0 (0)        ;time base driven by time code
  194. timeCodeFormat             ds.w   1        ; offset: $2 (2)        ;format of time code to listen to
  195. timeCodeProc             ds.l   1        ; offset: $4 (4)        ;proc called on time code fmt change
  196. commProc                 ds.l   1        ; offset: $8 (8)        ;proc called for handshaking
  197. refCon                     ds.l   1        ; offset: $C (12)        ;refCon passed to timeCodeProc
  198. timeCodeFilter             ds.b   1        ; offset: $10 (16)        ;filter time code if true
  199. padding                     ds.b   1        ; offset: $11 (17)        ;unused pad byte
  200. midiMsgTicks             ds.l   1        ; offset: $12 (18)        ;value of Ticks when MIDI msg rcvd
  201. timeCodeTicks             ds.l   1        ; offset: $16 (22)        ;value of Ticks when time code rcvd
  202. sizeof                     EQU *            ; size:   $1A (26)
  203.                         ENDR
  204.  
  205. ; typedef struct MDVROutCtlRec  *MDVROutCtlPtr
  206. ; typedef void                 *MDVRPtr
  207. ; MIDIVersion() return a NumVersion
  208. ;
  209. ; pascal unsigned long MIDIVersion(void)
  210. ;
  211.     IF ¬ GENERATINGCFM THEN
  212.         Macro
  213.         _MIDIVersion
  214.             dc.w     $203C
  215.             dc.w     $0000
  216.             dc.w     $0004
  217.             dc.w     $A800
  218.         EndM
  219.     ELSE
  220.         IMPORT_CFM_FUNCTION    MIDIVersion
  221.     ENDIF
  222.  
  223. ;
  224. ; pascal OSErr MIDISignIn(OSType clientID, long refCon, Handle icon, ConstStr255Param name)
  225. ;
  226.     IF ¬ GENERATINGCFM THEN
  227.         Macro
  228.         _MIDISignIn
  229.             dc.w     $203C
  230.             dc.w     $0004
  231.             dc.w     $0004
  232.             dc.w     $A800
  233.         EndM
  234.     ELSE
  235.         IMPORT_CFM_FUNCTION    MIDISignIn
  236.     ENDIF
  237.  
  238. ;
  239. ; pascal void MIDISignOut(OSType clientID)
  240. ;
  241.     IF ¬ GENERATINGCFM THEN
  242.         Macro
  243.         _MIDISignOut
  244.             dc.w     $203C
  245.             dc.w     $0008
  246.             dc.w     $0004
  247.             dc.w     $A800
  248.         EndM
  249.     ELSE
  250.         IMPORT_CFM_FUNCTION    MIDISignOut
  251.     ENDIF
  252.  
  253. ;
  254. ; pascal MIDIIDListHandle MIDIGetClients(void)
  255. ;
  256.     IF ¬ GENERATINGCFM THEN
  257.         Macro
  258.         _MIDIGetClients
  259.             dc.w     $203C
  260.             dc.w     $000C
  261.             dc.w     $0004
  262.             dc.w     $A800
  263.         EndM
  264.     ELSE
  265.         IMPORT_CFM_FUNCTION    MIDIGetClients
  266.     ENDIF
  267.  
  268. ;
  269. ; pascal void MIDIGetClientName(OSType clientID, Str255 name)
  270. ;
  271.     IF ¬ GENERATINGCFM THEN
  272.         Macro
  273.         _MIDIGetClientName
  274.             dc.w     $203C
  275.             dc.w     $0010
  276.             dc.w     $0004
  277.             dc.w     $A800
  278.         EndM
  279.     ELSE
  280.         IMPORT_CFM_FUNCTION    MIDIGetClientName
  281.     ENDIF
  282.  
  283. ;
  284. ; pascal void MIDISetClientName(OSType clientID, ConstStr255Param name)
  285. ;
  286.     IF ¬ GENERATINGCFM THEN
  287.         Macro
  288.         _MIDISetClientName
  289.             dc.w     $203C
  290.             dc.w     $0014
  291.             dc.w     $0004
  292.             dc.w     $A800
  293.         EndM
  294.     ELSE
  295.         IMPORT_CFM_FUNCTION    MIDISetClientName
  296.     ENDIF
  297.  
  298. ;
  299. ; pascal MIDIIDListHandle MIDIGetPorts(OSType clientID)
  300. ;
  301.     IF ¬ GENERATINGCFM THEN
  302.         Macro
  303.         _MIDIGetPorts
  304.             dc.w     $203C
  305.             dc.w     $0018
  306.             dc.w     $0004
  307.             dc.w     $A800
  308.         EndM
  309.     ELSE
  310.         IMPORT_CFM_FUNCTION    MIDIGetPorts
  311.     ENDIF
  312.  
  313. ;
  314. ; pascal OSErr MIDIAddPort(OSType clientID, short BufSize, short *refnum, MIDIPortParamsPtr init)
  315. ;
  316.     IF ¬ GENERATINGCFM THEN
  317.         Macro
  318.         _MIDIAddPort
  319.             dc.w     $203C
  320.             dc.w     $001C
  321.             dc.w     $0004
  322.             dc.w     $A800
  323.         EndM
  324.     ELSE
  325.         IMPORT_CFM_FUNCTION    MIDIAddPort
  326.     ENDIF
  327.  
  328. ;
  329. ; pascal MIDIPortInfoHandle MIDIGetPortInfo(OSType clientID, OSType portID)
  330. ;
  331.     IF ¬ GENERATINGCFM THEN
  332.         Macro
  333.         _MIDIGetPortInfo
  334.             dc.w     $203C
  335.             dc.w     $0020
  336.             dc.w     $0004
  337.             dc.w     $A800
  338.         EndM
  339.     ELSE
  340.         IMPORT_CFM_FUNCTION    MIDIGetPortInfo
  341.     ENDIF
  342.  
  343. ;
  344. ; pascal OSErr MIDIConnectData(OSType srcClID, OSType srcPortID, OSType dstClID, OSType dstPortID)
  345. ;
  346.     IF ¬ GENERATINGCFM THEN
  347.         Macro
  348.         _MIDIConnectData
  349.             dc.w     $203C
  350.             dc.w     $0024
  351.             dc.w     $0004
  352.             dc.w     $A800
  353.         EndM
  354.     ELSE
  355.         IMPORT_CFM_FUNCTION    MIDIConnectData
  356.     ENDIF
  357.  
  358. ;
  359. ; pascal OSErr MIDIUnConnectData(OSType srcClID, OSType srcPortID, OSType dstClID, OSType dstPortID)
  360. ;
  361.     IF ¬ GENERATINGCFM THEN
  362.         Macro
  363.         _MIDIUnConnectData
  364.             dc.w     $203C
  365.             dc.w     $0028
  366.             dc.w     $0004
  367.             dc.w     $A800
  368.         EndM
  369.     ELSE
  370.         IMPORT_CFM_FUNCTION    MIDIUnConnectData
  371.     ENDIF
  372.  
  373. ;
  374. ; pascal OSErr MIDIConnectTime(OSType srcClID, OSType srcPortID, OSType dstClID, OSType dstPortID)
  375. ;
  376.     IF ¬ GENERATINGCFM THEN
  377.         Macro
  378.         _MIDIConnectTime
  379.             dc.w     $203C
  380.             dc.w     $002C
  381.             dc.w     $0004
  382.             dc.w     $A800
  383.         EndM
  384.     ELSE
  385.         IMPORT_CFM_FUNCTION    MIDIConnectTime
  386.     ENDIF
  387.  
  388. ;
  389. ; pascal OSErr MIDIUnConnectTime(OSType srcClID, OSType srcPortID, OSType dstClID, OSType dstPortID)
  390. ;
  391.     IF ¬ GENERATINGCFM THEN
  392.         Macro
  393.         _MIDIUnConnectTime
  394.             dc.w     $203C
  395.             dc.w     $0030
  396.             dc.w     $0004
  397.             dc.w     $A800
  398.         EndM
  399.     ELSE
  400.         IMPORT_CFM_FUNCTION    MIDIUnConnectTime
  401.     ENDIF
  402.  
  403. ;
  404. ; pascal void MIDIFlush(short refnum)
  405. ;
  406.     IF ¬ GENERATINGCFM THEN
  407.         Macro
  408.         _MIDIFlush
  409.             dc.w     $203C
  410.             dc.w     $0034
  411.             dc.w     $0004
  412.             dc.w     $A800
  413.         EndM
  414.     ELSE
  415.         IMPORT_CFM_FUNCTION    MIDIFlush
  416.     ENDIF
  417.  
  418. ;
  419. ; pascal ProcPtr MIDIGetReadHook(short refnum)
  420. ;
  421.     IF ¬ GENERATINGCFM THEN
  422.         Macro
  423.         _MIDIGetReadHook
  424.             dc.w     $203C
  425.             dc.w     $0038
  426.             dc.w     $0004
  427.             dc.w     $A800
  428.         EndM
  429.     ELSE
  430.         IMPORT_CFM_FUNCTION    MIDIGetReadHook
  431.     ENDIF
  432.  
  433. ;
  434. ; pascal void MIDISetReadHook(short refnum, ProcPtr hook)
  435. ;
  436.     IF ¬ GENERATINGCFM THEN
  437.         Macro
  438.         _MIDISetReadHook
  439.             dc.w     $203C
  440.             dc.w     $003C
  441.             dc.w     $0004
  442.             dc.w     $A800
  443.         EndM
  444.     ELSE
  445.         IMPORT_CFM_FUNCTION    MIDISetReadHook
  446.     ENDIF
  447.  
  448. ;
  449. ; pascal void MIDIGetPortName(OSType clientID, OSType portID, Str255 name)
  450. ;
  451.     IF ¬ GENERATINGCFM THEN
  452.         Macro
  453.         _MIDIGetPortName
  454.             dc.w     $203C
  455.             dc.w     $0040
  456.             dc.w     $0004
  457.             dc.w     $A800
  458.         EndM
  459.     ELSE
  460.         IMPORT_CFM_FUNCTION    MIDIGetPortName
  461.     ENDIF
  462.  
  463. ;
  464. ; pascal void MIDISetPortName(OSType clientID, OSType portID, ConstStr255Param name)
  465. ;
  466.     IF ¬ GENERATINGCFM THEN
  467.         Macro
  468.         _MIDISetPortName
  469.             dc.w     $203C
  470.             dc.w     $0044
  471.             dc.w     $0004
  472.             dc.w     $A800
  473.         EndM
  474.     ELSE
  475.         IMPORT_CFM_FUNCTION    MIDISetPortName
  476.     ENDIF
  477.  
  478. ;
  479. ; pascal void MIDIWakeUp(short refnum, long time, long period, MIDITimeUPP timeProc)
  480. ;
  481.     IF ¬ GENERATINGCFM THEN
  482.         Macro
  483.         _MIDIWakeUp
  484.             dc.w     $203C
  485.             dc.w     $0048
  486.             dc.w     $0004
  487.             dc.w     $A800
  488.         EndM
  489.     ELSE
  490.         IMPORT_CFM_FUNCTION    MIDIWakeUp
  491.     ENDIF
  492.  
  493. ;
  494. ; pascal void MIDIRemovePort(short refnum)
  495. ;
  496.     IF ¬ GENERATINGCFM THEN
  497.         Macro
  498.         _MIDIRemovePort
  499.             dc.w     $203C
  500.             dc.w     $004C
  501.             dc.w     $0004
  502.             dc.w     $A800
  503.         EndM
  504.     ELSE
  505.         IMPORT_CFM_FUNCTION    MIDIRemovePort
  506.     ENDIF
  507.  
  508. ;
  509. ; pascal short MIDIGetSync(short refnum)
  510. ;
  511.     IF ¬ GENERATINGCFM THEN
  512.         Macro
  513.         _MIDIGetSync
  514.             dc.w     $203C
  515.             dc.w     $0050
  516.             dc.w     $0004
  517.             dc.w     $A800
  518.         EndM
  519.     ELSE
  520.         IMPORT_CFM_FUNCTION    MIDIGetSync
  521.     ENDIF
  522.  
  523. ;
  524. ; pascal void MIDISetSync(short refnum, short sync)
  525. ;
  526.     IF ¬ GENERATINGCFM THEN
  527.         Macro
  528.         _MIDISetSync
  529.             dc.w     $203C
  530.             dc.w     $0054
  531.             dc.w     $0004
  532.             dc.w     $A800
  533.         EndM
  534.     ELSE
  535.         IMPORT_CFM_FUNCTION    MIDISetSync
  536.     ENDIF
  537.  
  538. ;
  539. ; pascal long MIDIGetCurTime(short refnum)
  540. ;
  541.     IF ¬ GENERATINGCFM THEN
  542.         Macro
  543.         _MIDIGetCurTime
  544.             dc.w     $203C
  545.             dc.w     $0058
  546.             dc.w     $0004
  547.             dc.w     $A800
  548.         EndM
  549.     ELSE
  550.         IMPORT_CFM_FUNCTION    MIDIGetCurTime
  551.     ENDIF
  552.  
  553. ;
  554. ; pascal void MIDISetCurTime(short refnum, long time)
  555. ;
  556.     IF ¬ GENERATINGCFM THEN
  557.         Macro
  558.         _MIDISetCurTime
  559.             dc.w     $203C
  560.             dc.w     $005C
  561.             dc.w     $0004
  562.             dc.w     $A800
  563.         EndM
  564.     ELSE
  565.         IMPORT_CFM_FUNCTION    MIDISetCurTime
  566.     ENDIF
  567.  
  568. ;
  569. ; pascal void MIDIStartTime(short refnum)
  570. ;
  571.     IF ¬ GENERATINGCFM THEN
  572.         Macro
  573.         _MIDIStartTime
  574.             dc.w     $203C
  575.             dc.w     $0060
  576.             dc.w     $0004
  577.             dc.w     $A800
  578.         EndM
  579.     ELSE
  580.         IMPORT_CFM_FUNCTION    MIDIStartTime
  581.     ENDIF
  582.  
  583. ;
  584. ; pascal void MIDIStopTime(short refnum)
  585. ;
  586.     IF ¬ GENERATINGCFM THEN
  587.         Macro
  588.         _MIDIStopTime
  589.             dc.w     $203C
  590.             dc.w     $0064
  591.             dc.w     $0004
  592.             dc.w     $A800
  593.         EndM
  594.     ELSE
  595.         IMPORT_CFM_FUNCTION    MIDIStopTime
  596.     ENDIF
  597.  
  598. ;
  599. ; pascal void MIDIPoll(short refnum, long offsetTime)
  600. ;
  601.     IF ¬ GENERATINGCFM THEN
  602.         Macro
  603.         _MIDIPoll
  604.             dc.w     $203C
  605.             dc.w     $0068
  606.             dc.w     $0004
  607.             dc.w     $A800
  608.         EndM
  609.     ELSE
  610.         IMPORT_CFM_FUNCTION    MIDIPoll
  611.     ENDIF
  612.  
  613. ;
  614. ; pascal OSErr MIDIWritePacket(short refnum, MIDIPacketPtr packet)
  615. ;
  616.     IF ¬ GENERATINGCFM THEN
  617.         Macro
  618.         _MIDIWritePacket
  619.             dc.w     $203C
  620.             dc.w     $006C
  621.             dc.w     $0004
  622.             dc.w     $A800
  623.         EndM
  624.     ELSE
  625.         IMPORT_CFM_FUNCTION    MIDIWritePacket
  626.     ENDIF
  627.  
  628. ;
  629. ; pascal Boolean MIDIWorldChanged(OSType clientID)
  630. ;
  631.     IF ¬ GENERATINGCFM THEN
  632.         Macro
  633.         _MIDIWorldChanged
  634.             dc.w     $203C
  635.             dc.w     $0070
  636.             dc.w     $0004
  637.             dc.w     $A800
  638.         EndM
  639.     ELSE
  640.         IMPORT_CFM_FUNCTION    MIDIWorldChanged
  641.     ENDIF
  642.  
  643. ;
  644. ; pascal long MIDIGetOffsetTime(short refnum)
  645. ;
  646.     IF ¬ GENERATINGCFM THEN
  647.         Macro
  648.         _MIDIGetOffsetTime
  649.             dc.w     $203C
  650.             dc.w     $0074
  651.             dc.w     $0004
  652.             dc.w     $A800
  653.         EndM
  654.     ELSE
  655.         IMPORT_CFM_FUNCTION    MIDIGetOffsetTime
  656.     ENDIF
  657.  
  658. ;
  659. ; pascal void MIDISetOffsetTime(short refnum, long offsetTime)
  660. ;
  661.     IF ¬ GENERATINGCFM THEN
  662.         Macro
  663.         _MIDISetOffsetTime
  664.             dc.w     $203C
  665.             dc.w     $0078
  666.             dc.w     $0004
  667.             dc.w     $A800
  668.         EndM
  669.     ELSE
  670.         IMPORT_CFM_FUNCTION    MIDISetOffsetTime
  671.     ENDIF
  672.  
  673. ;
  674. ; pascal long MIDIConvertTime(short srcFormat, short dstFormat, long time)
  675. ;
  676.     IF ¬ GENERATINGCFM THEN
  677.         Macro
  678.         _MIDIConvertTime
  679.             dc.w     $203C
  680.             dc.w     $007C
  681.             dc.w     $0004
  682.             dc.w     $A800
  683.         EndM
  684.     ELSE
  685.         IMPORT_CFM_FUNCTION    MIDIConvertTime
  686.     ENDIF
  687.  
  688. ;
  689. ; pascal long MIDIGetRefCon(short refnum)
  690. ;
  691.     IF ¬ GENERATINGCFM THEN
  692.         Macro
  693.         _MIDIGetRefCon
  694.             dc.w     $203C
  695.             dc.w     $0080
  696.             dc.w     $0004
  697.             dc.w     $A800
  698.         EndM
  699.     ELSE
  700.         IMPORT_CFM_FUNCTION    MIDIGetRefCon
  701.     ENDIF
  702.  
  703. ;
  704. ; pascal void MIDISetRefCon(short refnum, long refCon)
  705. ;
  706.     IF ¬ GENERATINGCFM THEN
  707.         Macro
  708.         _MIDISetRefCon
  709.             dc.w     $203C
  710.             dc.w     $0084
  711.             dc.w     $0004
  712.             dc.w     $A800
  713.         EndM
  714.     ELSE
  715.         IMPORT_CFM_FUNCTION    MIDISetRefCon
  716.     ENDIF
  717.  
  718. ;
  719. ; pascal long MIDIGetClRefCon(OSType clientID)
  720. ;
  721.     IF ¬ GENERATINGCFM THEN
  722.         Macro
  723.         _MIDIGetClRefCon
  724.             dc.w     $203C
  725.             dc.w     $0088
  726.             dc.w     $0004
  727.             dc.w     $A800
  728.         EndM
  729.     ELSE
  730.         IMPORT_CFM_FUNCTION    MIDIGetClRefCon
  731.     ENDIF
  732.  
  733. ;
  734. ; pascal void MIDISetClRefCon(OSType clientID, long refCon)
  735. ;
  736.     IF ¬ GENERATINGCFM THEN
  737.         Macro
  738.         _MIDISetClRefCon
  739.             dc.w     $203C
  740.             dc.w     $008C
  741.             dc.w     $0004
  742.             dc.w     $A800
  743.         EndM
  744.     ELSE
  745.         IMPORT_CFM_FUNCTION    MIDISetClRefCon
  746.     ENDIF
  747.  
  748. ;
  749. ; pascal short MIDIGetTCFormat(short refnum)
  750. ;
  751.     IF ¬ GENERATINGCFM THEN
  752.         Macro
  753.         _MIDIGetTCFormat
  754.             dc.w     $203C
  755.             dc.w     $0090
  756.             dc.w     $0004
  757.             dc.w     $A800
  758.         EndM
  759.     ELSE
  760.         IMPORT_CFM_FUNCTION    MIDIGetTCFormat
  761.     ENDIF
  762.  
  763. ;
  764. ; pascal void MIDISetTCFormat(short refnum, short format)
  765. ;
  766.     IF ¬ GENERATINGCFM THEN
  767.         Macro
  768.         _MIDISetTCFormat
  769.             dc.w     $203C
  770.             dc.w     $0094
  771.             dc.w     $0004
  772.             dc.w     $A800
  773.         EndM
  774.     ELSE
  775.         IMPORT_CFM_FUNCTION    MIDISetTCFormat
  776.     ENDIF
  777.  
  778. ;
  779. ; pascal void MIDISetRunRate(short refnum, short rate, long time)
  780. ;
  781.     IF ¬ GENERATINGCFM THEN
  782.         Macro
  783.         _MIDISetRunRate
  784.             dc.w     $203C
  785.             dc.w     $0098
  786.             dc.w     $0004
  787.             dc.w     $A800
  788.         EndM
  789.     ELSE
  790.         IMPORT_CFM_FUNCTION    MIDISetRunRate
  791.     ENDIF
  792.  
  793. ;
  794. ; pascal Handle MIDIGetClientIcon(OSType clientID)
  795. ;
  796.     IF ¬ GENERATINGCFM THEN
  797.         Macro
  798.         _MIDIGetClientIcon
  799.             dc.w     $203C
  800.             dc.w     $009C
  801.             dc.w     $0004
  802.             dc.w     $A800
  803.         EndM
  804.     ELSE
  805.         IMPORT_CFM_FUNCTION    MIDIGetClientIcon
  806.     ENDIF
  807.  
  808. ;
  809. ; pascal ProcPtr MIDICallAddress(short callNum)
  810. ;
  811.     IF ¬ GENERATINGCFM THEN
  812.         Macro
  813.         _MIDICallAddress
  814.             dc.w     $203C
  815.             dc.w     $00A4
  816.             dc.w     $0004
  817.             dc.w     $A800
  818.         EndM
  819.     ELSE
  820.         IMPORT_CFM_FUNCTION    MIDICallAddress
  821.     ENDIF
  822.  
  823. ;
  824. ; pascal void MIDISetConnectionProc(short refNum, ProcPtr connectionProc, long refCon)
  825. ;
  826.     IF ¬ GENERATINGCFM THEN
  827.         Macro
  828.         _MIDISetConnectionProc
  829.             dc.w     $203C
  830.             dc.w     $00A8
  831.             dc.w     $0004
  832.             dc.w     $A800
  833.         EndM
  834.     ELSE
  835.         IMPORT_CFM_FUNCTION    MIDISetConnectionProc
  836.     ENDIF
  837.  
  838. ;
  839. ; pascal void MIDIGetConnectionProc(short refnum, ProcPtr *connectionProc, long *refCon)
  840. ;
  841.     IF ¬ GENERATINGCFM THEN
  842.         Macro
  843.         _MIDIGetConnectionProc
  844.             dc.w     $203C
  845.             dc.w     $00AC
  846.             dc.w     $0004
  847.             dc.w     $A800
  848.         EndM
  849.     ELSE
  850.         IMPORT_CFM_FUNCTION    MIDIGetConnectionProc
  851.     ENDIF
  852.  
  853. ;
  854. ; pascal void MIDIDiscardPacket(short refnum, MIDIPacketPtr packet)
  855. ;
  856.     IF ¬ GENERATINGCFM THEN
  857.         Macro
  858.         _MIDIDiscardPacket
  859.             dc.w     $203C
  860.             dc.w     $00B0
  861.             dc.w     $0004
  862.             dc.w     $A800
  863.         EndM
  864.     ELSE
  865.         IMPORT_CFM_FUNCTION    MIDIDiscardPacket
  866.     ENDIF
  867.  
  868. ;
  869. ; pascal OSErr MDVRSignIn(OSType clientID, long refCon, Handle icon, Str255 name)
  870. ;
  871.     IF ¬ GENERATINGCFM THEN
  872.         Macro
  873.         _MDVRSignIn
  874.             dc.w     $203C
  875.             dc.w     $00B4
  876.             dc.w     $0004
  877.             dc.w     $A800
  878.         EndM
  879.     ELSE
  880.         IMPORT_CFM_FUNCTION    MDVRSignIn
  881.     ENDIF
  882.  
  883. ;
  884. ; pascal void MDVRSignOut(OSType clientID)
  885. ;
  886.     IF ¬ GENERATINGCFM THEN
  887.         Macro
  888.         _MDVRSignOut
  889.             dc.w     $203C
  890.             dc.w     $00B8
  891.             dc.w     $0004
  892.             dc.w     $A800
  893.         EndM
  894.     ELSE
  895.         IMPORT_CFM_FUNCTION    MDVRSignOut
  896.     ENDIF
  897.  
  898. ;
  899. ; pascal MDVRPtr MDVROpen(short portType, short refnum)
  900. ;
  901.     IF ¬ GENERATINGCFM THEN
  902.         Macro
  903.         _MDVROpen
  904.             dc.w     $203C
  905.             dc.w     $00BC
  906.             dc.w     $0004
  907.             dc.w     $A800
  908.         EndM
  909.     ELSE
  910.         IMPORT_CFM_FUNCTION    MDVROpen
  911.     ENDIF
  912.  
  913. ;
  914. ; pascal void MDVRClose(MDVRPtr driverPtr)
  915. ;
  916.     IF ¬ GENERATINGCFM THEN
  917.         Macro
  918.         _MDVRClose
  919.             dc.w     $203C
  920.             dc.w     $00C0
  921.             dc.w     $0004
  922.             dc.w     $A800
  923.         EndM
  924.     ELSE
  925.         IMPORT_CFM_FUNCTION    MDVRClose
  926.     ENDIF
  927.  
  928. ;
  929. ; pascal void MDVRControlIn(MDVRPtr portPtr, MDVRInCtlPtr inputCtl)
  930. ;
  931.     IF ¬ GENERATINGCFM THEN
  932.         Macro
  933.         _MDVRControlIn
  934.             dc.w     $203C
  935.             dc.w     $00C4
  936.             dc.w     $0004
  937.             dc.w     $A800
  938.         EndM
  939.     ELSE
  940.         IMPORT_CFM_FUNCTION    MDVRControlIn
  941.     ENDIF
  942.  
  943. ;
  944. ; pascal void MDVRControlOut(MDVRPtr portPtr, MDVROutCtlPtr outputCtl)
  945. ;
  946.     IF ¬ GENERATINGCFM THEN
  947.         Macro
  948.         _MDVRControlOut
  949.             dc.w     $203C
  950.             dc.w     $00C8
  951.             dc.w     $0004
  952.             dc.w     $A800
  953.         EndM
  954.     ELSE
  955.         IMPORT_CFM_FUNCTION    MDVRControlOut
  956.     ENDIF
  957.  
  958. ;
  959. ; pascal void MDVRIn(MDVRPtr portPtr)
  960. ;
  961.     IF ¬ GENERATINGCFM THEN
  962.         Macro
  963.         _MDVRIn
  964.             dc.w     $203C
  965.             dc.w     $00CC
  966.             dc.w     $0004
  967.             dc.w     $A800
  968.         EndM
  969.     ELSE
  970.         IMPORT_CFM_FUNCTION    MDVRIn
  971.     ENDIF
  972.  
  973. ;
  974. ; pascal void MDVROut(MDVRPtr portPtr, char *dataPtr, short length)
  975. ;
  976.     IF ¬ GENERATINGCFM THEN
  977.         Macro
  978.         _MDVROut
  979.             dc.w     $203C
  980.             dc.w     $00D0
  981.             dc.w     $0004
  982.             dc.w     $A800
  983.         EndM
  984.     ELSE
  985.         IMPORT_CFM_FUNCTION    MDVROut
  986.     ENDIF
  987.  
  988. ;
  989. ; pascal void MDVRNotesOff(MDVRPtr portPtr, short mode)
  990. ;
  991.     IF ¬ GENERATINGCFM THEN
  992.         Macro
  993.         _MDVRNotesOff
  994.             dc.w     $203C
  995.             dc.w     $00D4
  996.             dc.w     $0004
  997.             dc.w     $A800
  998.         EndM
  999.     ELSE
  1000.         IMPORT_CFM_FUNCTION    MDVRNotesOff
  1001.     ENDIF
  1002.  
  1003.     ENDIF ; __MIDI__
  1004.